# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgbase=python-pypdf2
pkgname=('python2-pypdf2' 'python-pypdf2')
_pkgname=PyPDF2
pkgver=3.0.1
pkgrel=1
epoch=1
pkgdesc='PDF toolkit.'
arch=('any')
url='http://mstamy2.github.com/PyPDF2'
license=('BSD')
makedepends=('python2-setuptools' 'python-setuptools')
source=("https://files.pythonhosted.org/packages/source/${_pkgname::1}/$_pkgname/PyPDF2-$pkgver.tar.gz")
sha512sums=('8bca23a7aef28ebb724d1a2579a6d2fa7e8ae0530b6410ef54d88b46674aab726c37c2407107c3243ad52a7ebed4e19fdad01b4124145fc8fce12cb3b141d008')

prepare() {
  cp -a "$_pkgname-$pkgver"{,-2}
}

build() {
  cd "$_pkgname-$pkgver-2"

  python2 setup.py build

  cd "$srcdir/$_pkgname-$pkgver"

  python setup.py build
}

package_python2-pypdf2() {
  depends=('python2')

  cd "$_pkgname-$pkgver-2"

  python2 setup.py install --root="$pkgdir" --prefix=/usr -O1 --skip-build
}

package_python-pypdf2() {
  depends=('python')

  cd "$_pkgname-$pkgver"

  python setup.py install --root="$pkgdir" --prefix=/usr -O1 --skip-build
}

